#!/usr/bin/env bats

@test "static no-word: static (when dynamic is the same as static, nothing happens)" {
  cd $BATS_TEST_DIRNAME
  expected="file1:3:for loop that C-based languages
file1:4:  actually foreach loops.
file1:8:problems with for loops in"
  result="$(fish -c 'tbgs for')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs for no-word')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs no-word for')"; [ "$result" = "$expected" ]
}

@test "static no-word: dynamic overwrites static" {
  cd $BATS_TEST_DIRNAME
  expected="file1:3:for loop that C-based languages
file1:8:problems with for loops in"
  result="$(fish -c 'tbgs word for')";  [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs for word')"; [ "$result" = "$expected" ]
}
